Warn if a widget requests minimum size > natural size
authorHavoc Pennington <hp@pobox.com>
Mon, 6 Sep 2010 01:46:22 +0000 (21:46 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 6 Sep 2010 01:46:22 +0000 (21:46 -0400)
Since this makes no sense and there's no reason we should
have to check for it elsewhere just in case some widget is
busted.

https://bugzilla.gnome.org/show_bug.cgi?id=628808

gtk/gtksizerequest.c

index 02d2e79cb5237dd6ec841d28963b5a0b3242b6e6..77f99c40d880ea96e8a676ffb27e19f00ed5bd17 100644 (file)
@@ -282,6 +282,12 @@ compute_size_for_orientation (GtkSizeRequest    *request,
                                                                        &min_size, &nat_size);
         }
 
+      if (min_size > nat_size)
+        {
+          g_warning ("%s %p reported min size %d and natural size %d; natural size must be >= min size",
+                     G_OBJECT_TYPE_NAME (request), request, min_size, nat_size);
+        }
+
       /* Support for dangling "size-request" signals and forward derived
        * classes that will not default to a ->get_width() that
        * returns the values in the ->requisition cache.